﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace BGCOP.CAVTOP.WINFORMS
{
    public partial class frmTarjetas : Form
    {
        public frmTarjetas()
        {
            InitializeComponent();
        }

        private void tTarjetaBindingNavigatorSaveItem_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Desea realizar las operaciones pendientes?", Properties.Settings.Default.Titulo,
              MessageBoxButtons.YesNoCancel) == DialogResult.Yes)
            {
                try
                {
                    this.Validate();
                    this.tTarjetaBindingSource.EndEdit();
                    this.tableAdapterManager.UpdateAll(this.masterDBACDataSet);
                    MessageBox.Show("El registro se proceso con exito!", Properties.Settings.Default.Titulo
                                , MessageBoxButtons.OK);
                }
                catch (Exception ex)
                {

                    MessageBox.Show("error: " + ex.ToString(), Properties.Settings.Default.Titulo
                                 , MessageBoxButtons.OK,MessageBoxIcon.Error);
                }
                
            }
        }

        private void frmTarjetas_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'masterDBACDataSet.THorario' table. You can move, or remove it, as needed.
            this.tHorarioTableAdapter.Fill(this.masterDBACDataSet.THorario);
            // TODO: This line of code loads data into the 'masterDBACDataSet.TTarjeta' table. You can move, or remove it, as needed.
            this.tTarjetaTableAdapter.Fill(this.masterDBACDataSet.TTarjeta);

        }

        private void radGridView1_CellBeginEdit(object sender, Telerik.WinControls.UI.GridViewCellCancelEventArgs e)
        {
            e.Row.Cells[6].Value = true;
            e.Row.Cells[7].Value = false;
            e.Row.Cells[8].Value = false;
        }
    }
}
